package com.blops.kubernetes;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@SpringBootApplication
public class Springboot4K8sApplication {

	private static String[] strs;

	public static void main(String[] args) {
		strs = args;
		SpringApplication.run(Springboot4K8sApplication.class, args);
	}

	@Controller
	class index {

		@GetMapping("/")
		public @ResponseBody String k8sIndex() {
			if (strs != null) {
				for (String str : strs) {
					if(str.contains("active")) {
						return "hello word ["+str+"]";
					}
				}
			}
			return "  ";
		}
	}

}
